package com.topway.dsmflex.services.servers;

import java.util.List;

import com.Consts;
import com.topway.dsmflex.dao.servers.ServersMonitorDao;
import com.topway.dsmflex.model.servers.DataServerBean;
import com.topway.dsmflex.services.BaseServices;

public class ServersMonitorServiescs extends BaseServices<DataServerBean>{

	private ServersMonitorDao serversMonitorDao = null;
	
	public ServersMonitorServiescs(String dataFilePath) {
		super(dataFilePath);
		serversMonitorDao =ServersMonitorDao.getServersMonitorDao();
	}
	
	
	private static ServersMonitorServiescs serversMonitorServiescs = new ServersMonitorServiescs(Consts.DATAFILE_SERVERS);

	
	public synchronized static ServersMonitorServiescs getServersMonitorServiescs()
	{
		return serversMonitorServiescs;
	}
	
	
	public List<DataServerBean> getDataServerBeanList()
	{
		return this.getAllDataTable();
	}
	
	public void serversExceptionHander(DataServerBean d)
	{ 
		if(d.serverState==2)
		{
			serversMonitorDao.addServersException(d);
		}else if(d.serverState==1)
		{
			serversMonitorDao.updServersException(d);
		}
	}
	
}
